package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.lmx.repoDomain.tmodel.business.User;

import io.katharsis.resource.annotations.JsonApiLookupIncludeAutomatically;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 视频(托管腾讯)信息
 *
 * @author ytche
 * @date 2017年8月18日
 *
 */
@Entity
@Table(name = "tnb_video_info")
@JsonApiResource(type = "videoInfo")
public class VideoInfo extends BaseEntity {
	private static final long serialVersionUID = 1L;
	private String fileId;
	private String playUrl;
	private User uploadUser;
	private Integer uploadTime;
	private Integer expireTime;// 过期时间
	private Integer fileExistStatus;// 云端文件存在状态0否1是

	@Column(name = "file_id")
	public String getFileId() {
		return fileId;
	}

	public void setFileId(String fileId) {
		this.fileId = fileId;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.SELECT)
	@JsonApiToOne
	@JsonApiLookupIncludeAutomatically
	@JoinColumn(name = "user_id")
	public User getUploadUser() {
		return uploadUser;
	}

	public void setUploadUser(User uploadUser) {
		this.uploadUser = uploadUser;
	}

	@Column(name = "upload_time")
	public Integer getUploadTime() {
		return uploadTime;
	}

	public void setUploadTime(Integer uploadTime) {
		this.uploadTime = uploadTime;
	}

	@Column(name = "empire_time")
	public Integer getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(Integer expireTime) {
		this.expireTime = expireTime;
	}

	@Column(name = "play_url")
	public String getPlayUrl() {
		return playUrl;
	}

	public void setPlayUrl(String playUrl) {
		this.playUrl = playUrl;
	}

	@Column(name = "file_exists_status")
	public Integer getFileExistStatus() {
		return fileExistStatus;
	}

	public void setFileExistStatus(Integer fileExistStatus) {
		this.fileExistStatus = fileExistStatus;
	}
}
